<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>用户更新</title>
<s:include value="/app_common/common.jsp"></s:include>
<!-- 表单验证start -->
<script src="<s:property value='webctx'/>/libs/js/form/validationRule.js" type="text/javascript"></script>
<script src="<s:property value='webctx'/>/libs/js/form/validation.js" type="text/javascript"></script>
<!-- 表单验证end -->
</head>
<body>
	<div class="box2" panelWidth="900" panelTitle="研究总结<s:property value="summary.s_id==0?'新增':'修改'"/>">
		<form name="form2" id="form2" method="post" target="frmright">
		<s:if test="!(summary.s_code==null||summary.s_code=='')">
			<%--所属人编码 --%>
			<s:hidden name="summary.s_submit_ucode" id="y_submit_ucode"></s:hidden>
			<%--所属人名称 --%>
			<s:hidden name="summary.s_submit_uname" id="y_submit_uname"></s:hidden>
			<%--所属分部--%>
			<s:hidden name="summary.s_submit_dpcode" id="y_submit_dpcode"></s:hidden>
			<%--所属分部名称--%>
			<s:hidden name="summary.s_submit_dpname" id="y_submit_dpname"></s:hidden>
		</s:if>
		<s:else>
			<%--所属人编码 --%>
			<s:hidden name="summary.s_submit_ucode" id="y_submit_ucode" value="%{#session.u_code}"></s:hidden>
			<%--所属人名称 --%>
			<s:hidden name="summary.s_submit_uname" id="y_submit_uname" value="%{#session.u_name}"></s:hidden>
			<%--所属分部--%>
			<s:hidden name="summary.s_submit_dpcode" id="y_submit_dpcode" value="%{#session.userltdcode}"></s:hidden>
			<%--所属分部名称--%>
			<s:hidden name="summary.s_submit_dpname" id="y_submit_dpname" value="%{#session.userltdname}"></s:hidden>
		</s:else>
			<s:hidden name="summary.s_id" id="s_id"></s:hidden>
			<table class="tableStyle" style="line-height: 30px" formMode="transparent">
				<tr>
					<td>总结编号:</td>
					<td style="color: red;">
						<s:property value="summary.s_code==null||summary.s_code==''?'自动生成':summary.s_code"/>
					</td>
					<td>总结名称：</td>
					<td>
						<input type="text" name="summary.s_name" value="<s:property value="summary.s_name" />" class="validate[required]" maxlength="20">
						<span class="star">*</span>
					</td>
					<td>总结类别：</td>
					<td>
						<select name="summary.s_type" selectedValue="<s:property value='summary.s_type'/>" prompt="请选择" data='<s:property value="map.sel_14"/>' class="validate[required]"></select>
						<span class="star">*</span>
					</td>
					<td>重要程度：</td>
					<td>
						<select name="summary.s_levels" selectedValue="<s:property value='summary.s_levels'/>" prompt="请选择" data='<s:property value="map.sel_13"/>' class="validate[required]"></select>
						<span class="star">*</span>
					</td>
				</tr>
				<tr>
					<td>数据总结:</td>
					<td colspan="7">
						<textarea name="summary.s_data" style="width: 777px;height: 60px"><s:property value="summary.s_data"/></textarea>
					</td>
				</tr>
				<tr>
					<td>市场开发总结:</td>
					<td colspan="7">
						<textarea name="summary.s_sckf" style="width: 777px;height: 60px"><s:property value="summary.s_sckf"/></textarea>
					</td>
				</tr>
				<tr>
					<td>客户服务总结:</td>
					<td colspan="7">
						<textarea name="summary.s_khfw" style="width: 777px;height: 60px"><s:property value="summary.s_khfw"/></textarea>
					</td>
				</tr>
				<tr>
					<td>市场研究总结:</td>
					<td colspan="7">
						<textarea name="summary.s_scyj" style="width: 777px;height: 60px"><s:property value="summary.s_scyj"/></textarea>
					</td>
				</tr>
				<tr>
					<td>日常工作总结:</td>
					<td colspan="7">
						<textarea name="summary.s_rcgz" style="width: 777px;height: 60px"><s:property value="summary.s_rcgz"/></textarea>
					</td>
				</tr>
				<tr>
					<td>工作心得总结:</td>
					<td colspan="7">
						<textarea name="summary.s_gzxd" style="width: 777px;height: 60px"><s:property value="summary.s_gzxd"/></textarea>
					</td>
				</tr>
				<tr>
					<td>个人提升总结:</td>
					<td colspan="7">
						<textarea name="summary.s_grts" style="width: 777px;height: 60px"><s:property value="summary.s_grts"/></textarea>
					</td>
				</tr>
				<tr>
					<td>对公司工作要求:</td>
					<td colspan="7">
						<textarea name="summary.s_gsyq" style="width: 777px;height: 60px"><s:property value="summary.s_gsyq"/></textarea>
					</td>
				</tr>
				<tr>
					<td>提交时间:<s:property value=""/></td>
					<td>
						<s:property value="%{summary.s_code==null||summary.s_code==''?'自动生成':summary.s_submit_date.substring(0,10)}"/>
					</td>
					<td>提交人编码</td>
					<td>
						<s:property value="%{summary.s_code==null||summary.s_code==''?#session.u_code:summary.s_submit_ucode}"/>
					</td>
					<td>提交人名称</td>
					<td>
						<s:property value="%{summary.s_code==null||summary.s_code==''?#session.u_name:summary.s_submit_uname}"/>
					</td>
					<td>所属分部</td>
					<td>
						<s:property value="%{summary.s_code==null||summary.s_code==''?#session.userltdname:summary.s_submit_dpname}"/>
					</td>
				</tr>
				<tr>
					<td colspan="8">
					<input type="button" onclick="back()" value="返回" />&nbsp;&nbsp;
					<input type="button" id="btn1" onclick="checkSubmit()" value="提交" />
					</td>
				</tr>
			</table>
		</form>
	</div>
</body>
<script type="text/javascript">
var status = "<s:property value='summary.s_id' />";
function checkSubmit(){
	var actionUrl;
	var valid = $("#form2").validationEngine({returnIsValid: true});
	if(!valid){
		return false;
	}
	if(status=="0"){
		actionUrl = webctx+"/summary/summary_insertSummaryById.action";
		isback = true;
		back_url = webctx+"/summary/summary_querySummary.action";
	}else{
		actionUrl = webctx+"/summary/summary_updateSummaryById.action";
	}
	var actionData = $("#form2").serialize();
	showProgressBar();
	$.ajax({
		url:actionUrl,
		data:actionData,
		type : "post",
		cache : false,
		dataType : 'text',
		success : function(data) {
			if(data!=0){
				alert('操作成功!');
				if(status==0){
					window.location = webctx+"/summary/summary_querySummary.action";
				}
			}else{
				alert('操作失败!');
			}
			closeProgress();
		}
	});
}
function back(){
	top.Dialog.confirm("确认返回？",function(){
		showProgressBar();
		window.location = webctx+"/summary/summary_querySummary.action";
	});
	
}
</script>
</html>